package com.ceba.test.base.enums;

import org.apache.commons.lang.StringUtils;

import com.ceba.test.base.language.ResourceUtils;


/**
 * GStorageAddress 中  status 字段
 * 代表当前磁盘的状态
 * @author Administrator
 *
 */
public enum StorageStatusEnum {
	NOSTART("1","未开启","STORAGE_NO_START"),CAN("2","可用","STORAGE_CAN_USE"),FULL("3","已满","STORAGE_NO_STORAGE_SIZE");;
	StorageStatusEnum(String code,String name,String language) {
		this.code=code;
		this.name=name;
		this.language=language;
	}
	private String code;
	private String name;
	private String language;
	
	public String getLanguage() {
		return language;
	}
	public void setLanguage(String language) {
		this.language = language;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public static String getLanguageStr(String code){
		for(StorageStatusEnum status:StorageStatusEnum.values()){
			if(StringUtils.equals(code, status.code)){
				return ResourceUtils.getMessage(status.getLanguage());
			}
		}
		return null;
	}

}
